﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using NParameterizedTestTests.ObjectBuilders;
using System;
using System.Linq;

namespace NParameterizedTestTests.TestCollectionTests
{
    [TestClass]
    public class AddTestCase_tests
    {
        [TestMethod]
        public void Adding_a_test_case_puts_it_in_the_collection()
        {
            var testCase = new TestCaseBuilder().Build();
            var collection = new TestCollectionBuilder().Build();

            collection.AddTestCase(testCase);

            CollectionAssert.Contains(collection.ToList(), testCase);
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentNullException))]
        public void Adding_null_throws_an_exception()
        {            
            var collection = new TestCollectionBuilder().Build();

            collection.AddTestCase(null);            
        }
    }
}
